package edu.zut.oop_test;

/**
 * 加油站
 */
public class GasStation {

    String name;
    double stock;

    /**
     * 给汽车加油
     */
    public void addGas(double level) {
        System.out.println("加了" + level + "升油");
    }

    /**
     * @param car   具体的car
     * @param level 要加多少油
     */
    public void addGas(Car car, double level) {
        System.out.println("加完油后，油量为：" + (car.oil_level + level));
    }

    public static void main(String[] args) {
        GasStation gasStation = new GasStation();
        gasStation.name = "中石化NO001";
        gasStation.stock = 5000000;
        Car car = new Car();
        car.name = "小奔";
        car.oil_level = 10;
        gasStation.addGas(car,50);
    }

}
